/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package skat;

/**
 *
 * @author weinpau
 */
public class Card {

    protected int rank, suit;
    private int[] points = {0, 0, 0, 2, 3, 4, 10, 11};

    public Card(int c, int v) {
        suit = c;
        rank = v;
    }

    @Override
    public String toString() {
        return toString(false);
    }

    public String toString(boolean lg) {
        if (lg) {
            return Main.deck.getLongName(suit(), rank());
        } else {
            return Main.deck.getShortName(suit(), rank());
        }
    }

    public int suit() {
        return suit;
    }

    public int rank() {
        return rank;
    }

    public int value() {
        return points[rank()];
    }

    @Override
    public boolean equals(Object obj) {
        try {
            Card c = (Card) obj;
            return c.suit() == suit() && c.rank() == rank();
        } catch (Exception exep) {
            return false;
        }
    }
}
